import tip from '@/utils/tip';
import React from 'react';
import styles from './index.less';
import { Suc } from '@/utils/tip-template';

export default class IndexPage extends React.Component {
  showModal() {
    const data = {
      price: '100金币',
    };
    const btnGrp = [
      {
        text: '残忍放弃',
        action() {
          tip.hideModal();
        },
      },
      {
        text: '继续任务',
        action() {
          tip.hideModal();
        },
      },
    ];
    tip.showModal('温馨提示', Suc, btnGrp, data);
  }

  render() {
    return (
      <div className={styles.indexPage}>
        <h1 className={styles.title}>md-fe</h1>
        <div className={styles.wrap}>
          <button onClick={this.showModal.bind(this)}>tip.showModal()</button>
        </div>
      </div>
    );
  }
}
